EPD Extension Kit for MSP430 LaunchPad
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
EPD_COG_process.h
Go to the documentation of this file.
1 
34 #ifndef DISPLAY_COG_PROCESS__H_INCLUDED
35 #define DISPLAY_COG_PROCESS__H_INCLUDED
36 
40 #define BLACK0 (uint8_t)(0x03)
41 #define BLACK1 (uint8_t)(0x0C)
42 #define BLACK2 (uint8_t)(0x30)
43 #define BLACK3 (uint8_t)(0xC0)
44 #define WHITE0 (uint8_t)(0x02)
45 #define WHITE1 (uint8_t)(0x08)
46 #define WHITE2 (uint8_t)(0x20)
47 #define WHITE3 (uint8_t)(0x80)
48 #define NOTHING0 (uint8_t)(0x01)
49 #define NOTHING1 (uint8_t)(0x04)
50 #define NOTHING2 (uint8_t)(0x10)
51 #define NOTHING3 (uint8_t)(0x40)
52 #define NOTHING (uint8_t)(0x55)
55 #define ALL_BLACK (uint8_t)(0xFF)
56 #define ALL_WHITE (uint8_t)(0xAA)
57 #define BORDER_BYTE_B (uint8_t)(0xFF)
58 #define BORDER_BYTE_W (uint8_t)(0xAA)
59 #define ERROR_BUSY (uint8_t)(0xF0)
60 #define ERROR_COG_ID (uint8_t)(0xF1)
61 #define ERROR_BREAKAGE (uint8_t)(0xF2)
62 #define ERROR_DC (uint8_t)(0xF3)
63 #define ERROR_CHARGEPUMP (uint8_t)(0xF4)
64 #define RES_OK (uint8_t)(0x00)
65 
69 #define LINE_BUFFER_DATA_SIZE 111
70 
73 #define COUNT_OF_EPD_TYPE 3
74 
77 enum Stage {
82 };
83 
84 #if (defined COG_V110)
85 
91 struct COG_144_line_data_t {
92  uint8_t border_byte;
93  uint8_t even[16];
94  uint8_t scan[24];
95  uint8_t odd [16];
96 } ;
97 
104 struct COG_200_line_data_t {
105  uint8_t even[25];
106  uint8_t scan[24];
107  uint8_t odd [25];
108  uint8_t dummy_data;
109 } ;
110 
117 struct COG_270_line_data_t {
118  uint8_t even[33];
119  uint8_t scan[44];
120  uint8_t odd [33];
121  uint8_t dummy_data;
122 } ;
123 
124 #elif (defined COG_V110_G2)
125 
132 struct COG_144_line_data_t {
133  uint8_t even[16];
134  uint8_t scan[24];
135  uint8_t odd [16];
136  uint8_t border_byte;
137 } ;
138 
145 struct COG_200_line_data_t {
146  uint8_t border_byte;
147  uint8_t even[25];
148  uint8_t scan[24];
149  uint8_t odd [25];
150 } ;
151 
158 struct COG_270_line_data_t {
159  uint8_t border_byte;
160  uint8_t even[33];
161  uint8_t scan[44];
162  uint8_t odd [33];
163 } ;
164 
165 #elif (defined COG_V230)
166 
172 struct COG_144_line_data_t {
173  uint8_t even[16];
174  uint8_t scan[24];
175  uint8_t odd [16];
176  uint8_t border_byte;
177 } ;
178 
185 struct COG_200_line_data_t {
186  uint8_t border_byte;
187  uint8_t even[25];
188  uint8_t scan[24];
189  uint8_t odd [25];
190 } ;
191 
198 struct COG_270_line_data_t {
199  uint8_t border_byte;
200  uint8_t even[33];
201  uint8_t scan[44];
202  uint8_t odd [33];
203 } ;
204 
205 enum Temperature_Range
206 {
207  TR0,
208  TR1,
209  TR2,
210  TR3,
211  TR4,
212  TR5,
213  TR6
214 };
215 enum Frame_mode
216 {
217  FRAME_A,
218  FRAME_B,
219  FRAME_C,
220  FRAME_D,
221  FRAME_E
222 };
223 struct Stage_Parameters_t
224 {
225  uint16_t Stage1_T1;
226  uint16_t Stage1_T2;
227  uint16_t Stage1_Cycle;
228 
229  uint16_t Stage2_T3;
230  uint16_t Stage2_T4;
231  uint16_t Stage2_T5;
232  uint16_t Stage2_Cycle;
233  uint16_t Stage2_T6;
234  uint16_t Stage2_T7;
235 
236  uint16_t Stage3_T8;
237  uint16_t Stage3_T9;
238  uint16_t Stage3_Cycle;
239 } ;
240 #else
241 #error "ERROR: The EPD's COG type is not defined."
242 #endif
243 
246 typedef union {
247  union {
248  struct COG_144_line_data_t line_data_for_144;
249  struct COG_200_line_data_t line_data_for_200;
250  struct COG_270_line_data_t line_data_for_270;
251  } line_data_by_size;
252  uint8_t uint8[LINE_BUFFER_DATA_SIZE];
254 
258  uint8_t channel_select[8];
259  uint8_t voltage_level;
260  uint16_t horizontal_size;
261  uint16_t vertical_size;
262  uint8_t data_line_size;
263  uint16_t frame_time_offset;
264  uint16_t stage_time;
265 } ;
266 
268 extern const uint8_t SCAN_TABLE[4];
269 void EPD_init(void);
270 void EPD_power_on (void);
271 uint8_t EPD_initialize_driver (uint8_t EPD_type_index);
272 void EPD_display_from_array_prt (uint8_t EPD_type_index, uint8_t *previous_image_ptr,
273 uint8_t *new_image_ptr);
274 void EPD_display_from_flash_prt (uint8_t EPD_type_index, long previous_image_flash_address,
275  long new_image_flash_address,EPD_read_flash_handler On_EPD_read_flash);
276 uint8_t EPD_power_off (uint8_t EPD_type_index);
277 void COG_driver_EPDtype_select(uint8_t EPD_type_index);
278 
279 #endif //DISPLAY_COG_PROCESS__H_INCLUDED
280